#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"

cmd-tags-default() {
  declare desc="shows docker images tags for app via command line"
  declare cmd="tags"
  [[ "$1" == "$cmd" ]] && shift 1
  declare APP="$1"

  [[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on"
  verify_app_name "$APP"

  local IMAGE_REPO=$(get_app_image_repo "$APP")
  dokku_log_info2_quiet "Image tags for $IMAGE_REPO"
  "$DOCKER_BIN" image list "$IMAGE_REPO"
}

cmd-tags-default "$@"
